using UnityEngine;
using System.Collections;

public class openGamesMenu : MonoBehaviour {
	
	public enum GameNames { Pairs, Colors, Space };
	public GameNames gameName;
	
    // Use this for initialization
	void Start () {
        AutoResize(480, 320);
    }

	// Update is called once per frame
    void Update() {
		// Exit if native Back-button is clicked
        if( Input.GetKeyDown(KeyCode.Escape) ) {
            Application.Quit();
        }
		
        if( Helper.CheckTouch(gameObject) ) {
			// Do the stuff here...
			OnMouseDown();
		}
    }

	// for testing...
    private void OnMouseDown() {
		GM.LastGame = gameName.ToString();
		Application.LoadLevel( gameName.ToString() );
    }
	
    public static void AutoResize(int screenWidth, int screenHeight)
    {
        Vector2 resizeRatio = new Vector2((float)Screen.width / screenWidth, (float)Screen.height / screenHeight);
        GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(resizeRatio.x, resizeRatio.y, 1.0f));
    }
}

